<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/5/24
 * Time: 16:15
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\api\controller;


use app\common\lib\Show;
use app\common\lib\Status;
use app\common\validate\User;

class Login extends BaseApi
{
    public function index()
    {
        $phoneNumber = $this->request->param('phone_number', '', 'trim');
        $code = $this->request->param('code', 0, 'intval');
        $type = $this->request->param('type', 0, 'intval');
        $data = [
            "phone_number" => $phoneNumber,
            "code" => $code,
            "type" => $type
        ];
        $validate = new User();
        if (!$validate->scene('login')->check($data)) {
            return Show::json_show(Status::Error, $validate->getError());
        }
    }
}